import React from "react"
import PropTypes from "prop-types"

class TodoItem extends React.Component {
  componentDidUpdate(){
    console.log('TodoItem did update')
  }

  render() {
    const { handleClick, content, text } = this.props

    return (
      <li onClick={handleClick}>
        {text} - {content}
      </li>
    )
  }
}

TodoItem.propTypes = {
  test: PropTypes.string.isRequired,
  content: PropTypes.string,
  handleClick: PropTypes.func
}

TodoItem.defaultProps = {
  test: "Hello World"
}

export default TodoItem
